/*
 * Copyright (c) 2007 jNetX.
 * http://www.jnetx.com
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * jNetX. You shall not disclose such Confidential Information and
 * shall use it only in accordance with the terms of the license
 * agreement you entered into with jNetX.
 *
 * $Id$
 */
package com.jnetx.javax.sip.util;

/**
 * @author <a href="mailto:dparhonin@jnetx.ru">Dmitry Parhonin</a>
 * @version $Revision$
 */
public class ByteData {
    private final byte[] data;
    private final int start;
    private final int end;

    public ByteData(byte[] data, int start, int end) {
        this.data = data;
        this.start = start;
        this.end = end;
    }

    public byte[] getData() {
        return data;
    }

    public int getStart() {
        return start;
    }

    public int getEnd() {
        return end;
    }

    public String asString() {
        return new String(data, start, end - start);
    }

    public String toString() {
        return "ByteData{" +
                "data=" + data +
                ", start=" + start +
                ", end=" + end +
                '}';
    }
}
/*
 * $Log$
 */